package com.wao.cms.service.dto;


import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;
import java.util.Objects;
import javax.persistence.Lob;

/**
 * A DTO for the PropertyValue entity.
 */
public class PropertyValueDTO implements Serializable {

    private Long id;

    @Lob
    private String value;

    @Size(max = 8)
    private String langKey;

    private Long pageId;

    private String pageName;

    private Long propertyId;

    private String propertyName;

    private Long materialId;

    private String materialName;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getLangKey() {
        return langKey;
    }

    public void setLangKey(String langKey) {
        this.langKey = langKey;
    }

    public Long getPageId() {
        return pageId;
    }

    public void setPageId(Long pageId) {
        this.pageId = pageId;
    }

    public String getPageName() {
        return pageName;
    }

    public void setPageName(String pageName) {
        this.pageName = pageName;
    }

    public Long getPropertyId() {
        return propertyId;
    }

    public void setPropertyId(Long templatePropertyId) {
        this.propertyId = templatePropertyId;
    }

    public String getPropertyName() {
        return propertyName;
    }

    public void setPropertyName(String templatePropertyName) {
        this.propertyName = templatePropertyName;
    }

    public Long getMaterialId() {
        return materialId;
    }

    public void setMaterialId(Long materialId) {
        this.materialId = materialId;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        PropertyValueDTO propertyValueDTO = (PropertyValueDTO) o;
        if(propertyValueDTO.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), propertyValueDTO.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "PropertyValueDTO{" +
            "id=" + getId() +
            ", value='" + getValue() + "'" +
            ", langKey='" + getLangKey() + "'" +
            "}";
    }
}
